//
//  GraphicsDefines.h
//  Utilities
//
//  Created by Goffredo Marocchi on 12/6/10.
//  Copyright 2010 IGGS. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <CoreGraphics/CGBase.h>

typedef struct
{
	CGFloat	x;
	CGFloat y;
} Vector2f, Vertex2f, vec2;


typedef struct
{
	u_int x;
	u_int y;
} Vector2ui;
typedef Vector2ui Vertex2ui;

typedef struct
{
	CGFloat	x;
	CGFloat y;
	CGFloat z;
} Vector3f, vec3, Vertex3f;

typedef struct
{
	u_int x;
	u_int y;
	u_int z;
} Vector3ui;
typedef Vector3ui Vertex3ui;

typedef struct
{
	u_char r;
	u_char g;
	u_char b;
	u_char a;
} Color4b;

typedef struct {
	Vector3f position;
	Vector2f texcoord;
} VertexBufferElement;

// Index to bind the attributes to vertex shaders
typedef enum vShaderAttributes{
    ATTRIB_VERTEX,
    ATTRIB_TEXCOORD,
	ATTRIB_NORMAL,
	ATTRIB_TANGENT,
    NUM_ATTRIBUTES
} vShaderAttributes;

#import "CoreGraphicsExt.h"
#import "MathHelper.h"

#define ROT_X(xin, yin, angle)    ((xin * cos(angle)) - (yin * sin(angle)))
#define ROT_Y(xin, yin, angle)    ((xin * sin(angle)) + (yin * cos(angle)))

